/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.vista;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Yessy
 */
@ManagedBean
@SessionScoped
public class AccesBean {

    private String user;
     private String pass;

    public AccesBean() {
    
    }
//acceso de datos temporal
//el expression
    //{# -nombre del bean- propiedad}
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }
    
    
    //actions
    public String procesarAccion(){
        FacesContext contex= FacesContext.getCurrentInstance();
        contex.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", user);
        if(user.equals("root")&& pass.equals("12345")){
         return "MenuPrincipal";
        }else{
        return "pagina2";
        }
   
    }

   
    
}
